package com.zhousb.deviceManager.controller;

import com.zhousb.deviceManager.common.R;
import com.zhousb.deviceManager.common.ResponseResult;
import com.zhousb.deviceManager.service.PositionService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/position")
public class PositionController {
    @Resource
    PositionService positionService;

    @GetMapping("/list")
    public ResponseResult<?> listPosition(@RequestParam("clientId")String clientId,@RequestParam("floorName")String floorName) {
        return R.success(positionService.listPosition(clientId,floorName));
    }

    @GetMapping("/add")
    public ResponseResult<?> add(@RequestParam("floorId")String floorId,@RequestParam("position")String position) {
        return R.success(positionService.add(floorId,position));
    }

    @GetMapping("/delete")
    public ResponseResult<?> delete(@RequestParam("id")String id) {
        return R.success(positionService.delete(id));
    }
}
